import { Component } from 'react';
import { Swiper } from 'react-vant';
import './index.less'
import { Image, Loading } from 'react-vant'
class HomeSwiper extends Component {
    render() {
        console.log(this.props.banners)
        return (
            <div className='HomeSwiper'>
                <Swiper autoplay={3000}>
                    {
                        this.props.banners.map((item, index) => {
                            return (
                                <Swiper.Item key={index}>
                                    <div>
                                        <Image
                                            loadingIcon={<Loading type='spinner' />}
                                            width='100%'
                                            src={item.pic}
                                            lazyload={true}
                                            height='160px'
                                        />
                                    </div>
                                </Swiper.Item>
                            )
                        })
                    }

                </Swiper>
            </div >
        )
    }
}
export default HomeSwiper